<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
<!-- hellovulkancubes.qdoc -->
  <title>Hello Vulkan Cubes Example | Qt GUI 5.14.2</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td ><a href="../qtdoc/index.html">Qt 5.14</a></td><td ><a href="qtgui-index.html">Qt GUI</a></td><td >Hello Vulkan Cubes Example</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtgui-index.html">Qt 5.14.2 Reference Documentation</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#running-the-example">Running the Example</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">Hello Vulkan Cubes Example</h1>
<span class="subtitle"></span>
<!-- $$$hellovulkancubes-brief -->
<p>Shows the basics of using <a href="qvulkanwindow.html">QVulkanWindow</a>.</p>
<!-- @@@hellovulkancubes -->
<!-- $$$hellovulkancubes-description -->
<div class="descr"> <a name="details"></a>
<p>The <i>Hello Vulkan Cubes Example</i> shows more advanced usage of <a href="qvulkanwindow.html">QVulkanWindow</a>.</p>
<p class="centerAlign"><img src="images/hellovulkancubes.png" alt="" /></p><p>In this example there is a mesh loaded from a file and two different materials and corresponding graphics pipelines. The rounded cubes are drawn using instancing and feature a Phong lighting model with a single directional light.</p>
<p>Unlike hellovulkantexture and hellovulkantriangle, the uniform buffer handling takes an alternative approach here: dynamic uniform buffers are used instead of multiple descriptor sets.</p>
<p>The example requires QtConcurrent since it demonstrates simple usage of QtConcurrent::run(), <a href="../qtcore/qfuture.html">QFuture</a>, and <a href="../qtcore/qfuturewatcher.html">QFutureWatcher</a> in combination of <a href="qvulkanwindow.html">QVulkanWindow</a>. Mesh and shader data loading, the potentially expensive graphics pipeline construction, and the building of the frame command buffer are all done in separate worker threads.</p>
<p>The scene is embedded into a widget-based user interface. The <a href="qvulkanwindow.html">QVulkanWindow</a> subclass handles mouse and keyboard input as well since it provides a first-person style camera in order to allow moving around in the scene.</p>
<a name="running-the-example"></a>
<h4 id="running-the-example">Running the Example</h4>
<p>To run the example from <a href="http://doc.qt.io/qtcreator/index.html">Qt Creator</a>, open the <b>Welcome</b> mode and select the example from <b>Examples</b>. For more information, visit <a href="http://doc.qt.io/qtcreator/creator-build-example-application.html">Building and Running an Example</a>.</p>
<p><a href="https://code.qt.io/cgit/qt/qtbase.git/tree/examples/vulkan/hellovulkancubes?h=5.14">Example project @ code.qt.io</a></p>
</div>
<!-- @@@hellovulkancubes -->
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2020 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br/>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>
